﻿using System;
using System.Collections;
using System.Data;
using CE.Database;

/// <summary>
/// Summary description for TAPersonnelDB
/// </summary>
/// 
namespace CE.TravelInsurance
{
    public class TAPersonnelDB
    {
        public TAPersonnelDB()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        public Int64 Insert(TAPersonnel tapersonnel)
        {
            MyDatabase _db = new MyDatabase();
            Int64 _result = -1;
            string _spName = "sprocTAPersonnelInsertUpdateSingleItem";

            SortedList _sPara = new SortedList();
            #region Parameter

            _sPara.Add("@TAPersonnelId", tapersonnel.TAPersonnelId);
            _sPara.Add("@TAInsID", tapersonnel.TAInsId);
            _sPara.Add("@TAAppSeaId", tapersonnel.TAAppSeaId);
            _sPara.Add("@TAPlanType", tapersonnel.TAPlanType);
            _sPara.Add("@TASalutation", tapersonnel.TASalutation);
            _sPara.Add("@TAFirstname", tapersonnel.TAFirstName);
            _sPara.Add("@TASurname", tapersonnel.TASurname);
            _sPara.Add("@TAIdentificationType", tapersonnel.TAIdentificationType);
            _sPara.Add("@TAIdentificationNum", tapersonnel.TAIdentificationNum);
            _sPara.Add("@TAGender", tapersonnel.TAGender);
            _sPara.Add("@TAAddress", tapersonnel.TAAddress);
            _sPara.Add("@TAPostcode", tapersonnel.TAPostcode);
            _sPara.Add("@TABirthday", tapersonnel.TABirthday);
            _sPara.Add("@TANationality", tapersonnel.TANationality);
            _sPara.Add("@TAResidentialNum", tapersonnel.TAResidentialNum);
            _sPara.Add("@TAMobileNum", tapersonnel.TAMobileNum);
            _sPara.Add("@TAOfficeNum", tapersonnel.TAOfficeNum);
            _sPara.Add("@TravellerToBeInsured", tapersonnel.TravellerToBeInsured);
            _sPara.Add("@Status", tapersonnel.Status);
            _sPara.Add("@RefCEUserId", tapersonnel.RefCEUserId);
            _sPara.Add("@ViewedDetailId", tapersonnel.ViewedDetailId);
            _sPara.Add("@Info1", tapersonnel.Info1);
            _sPara.Add("@Info2", tapersonnel.Info2);
            _sPara.Add("@Info3", tapersonnel.Info3);
            _sPara.Add("@Info4", tapersonnel.Info4);
            _sPara.Add("@Info5", tapersonnel.Info5);

            #endregion

            _result = _db.ExecuteSP(_spName, _sPara);

            return _result;
        }

        

    }
}
